##############################################################
# Makefile
#
# Programmer:  Philippe Gambling
#
# Course:  CSCI 4534
#
# Date:  April 15, 2009
#
# Assignment:  #4
#
# Environment:  GCC 3.2.2 running on diamond.rocks.uhcl.edu
#
##############################################################

CC = gcc
CFLAGS = -Wall
SERVER_NAME = server
SERVER_SRC = server.c
CLIENT_NAME = client
CLIENT_SRC = client.c
QUEUE_SRC = queue/*.c
QUEUE_INCLUDE = queue/*.h
MEMORY_SRC = memory/*.c
MEMORY_INCLUDE = memory/*.h
PCB_SRC = pcb.c
TEST_SCRIPT = test.sh
COMMON_FILES = pcb.h $(PCB_SRC)

all: $(SERVER_NAME) $(CLIENT_NAME)
	./$(TEST_SCRIPT)
$(SERVER_NAME): $(SERVER_SRC) $(QUEUE_SRC) $(COMMON_FILES) $(QUEUE_INCLUDE) $(MEMORY_INCLUDE) $(MEMORY_SRC)
	$(CC) $(CFLAGS) -o $(SERVER_NAME) $(SERVER_SRC) $(QUEUE_SRC) $(PCB_SRC) $(MEMORY_SRC)

$(CLIENT_NAME): $(CLIENT_SRC) $(COMMON_FILES)
	$(CC) $(CFLAGS) -o $(CLIENT_NAME) $(CLIENT_SRC) $(PCB_SRC)
	
clean:
	rm -rf $(SERVER_NAME) $(CLIENT_NAME) tests/results/*

